Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation: Add README file about how artifacts version is set in the pipeline #9148

Merged
merged 6 commits into from
May 28, 2024

Conversation

mary-georgiou-sonarsource
Copy link
Contributor

@mary-georgiou-sonarsource mary-georgiou-sonarsource commented Apr 19, 2024

No description provided.

@mary-georgiou-sonarsource mary-georgiou-sonarsource marked this pull request as draft April 19, 2024 13:38
@mary-georgiou-sonarsource mary-georgiou-sonarsource force-pushed the mary/doc-versioning branch 6 times, most recently from b63a7cb to e0e675e Compare April 19, 2024 14:06
@mary-georgiou-sonarsource mary-georgiou-sonarsource changed the title document versioning Documentation: Add README file describing how artifacts version is set in the pipeline Apr 19, 2024
@mary-georgiou-sonarsource mary-georgiou-sonarsource changed the title Documentation: Add README file describing how artifacts version is set in the pipeline Documentation: Add README file about how artifacts version is set in the pipeline Apr 19, 2024
@mary-georgiou-sonarsource mary-georgiou-sonarsource marked this pull request as ready for review April 19, 2024 14:09
Copy link

sonarcloud bot commented Apr 19, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link
Contributor

@pavel-mikula-sonarsource pavel-mikula-sonarsource left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably need to pair to build a basic outline first.

The story describes individual details, but I don't explain the overal picture, like what are the entrypoints.

scripts/version/set-version.ps1 Outdated Show resolved Hide resolved
scripts/version/README.md Outdated Show resolved Hide resolved
scripts/version/README.md Outdated Show resolved Hide resolved
scripts/version/README.md Outdated Show resolved Hide resolved
scripts/version/README.md Outdated Show resolved Hide resolved
scripts/version/README.md Outdated Show resolved Hide resolved
scripts/version/README.md Outdated Show resolved Hide resolved
scripts/version/README.md Outdated Show resolved Hide resolved
scripts/version/README.md Outdated Show resolved Hide resolved
scripts/version/README.md Outdated Show resolved Hide resolved
Copy link
Contributor

@pavel-mikula-sonarsource pavel-mikula-sonarsource left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Round 2

scripts/version/README.md Outdated Show resolved Hide resolved
scripts/version/README.md Outdated Show resolved Hide resolved
scripts/version/README.md Outdated Show resolved Hide resolved
scripts/version/README.md Outdated Show resolved Hide resolved
scripts/version/README.md Outdated Show resolved Hide resolved
scripts/version/README.md Outdated Show resolved Hide resolved
scripts/version/README.md Show resolved Hide resolved
scripts/version/README.md Outdated Show resolved Hide resolved
scripts/version/README.md Outdated Show resolved Hide resolved
@mary-georgiou-sonarsource mary-georgiou-sonarsource force-pushed the mary/doc-versioning branch 3 times, most recently from 0bf4c9e to c892851 Compare May 27, 2024 09:26
Copy link
Contributor

@pavel-mikula-sonarsource pavel-mikula-sonarsource left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


To set the version locally we run the [`set-version.ps1`](./set-version.ps1) script, which uses the `mvn set:version` command to update the java plugin's semantic version and the `ChangeVersion.proj` to update the analyzers' semantic version. Later, the `ChangeVersion.proj` and the `mvn set:version` (via the [`update-maven-version-steps.yml`](https://dev.azure.com/sonarsource/DotNetTeam%20Project/_git/pipelines-yaml-templates?path=/update-maven-version-steps.yml&version=GBmaster&line=20&lineEnd=21&lineStartColumn=1&lineEndColumn=1&lineStyle=plain&_a=contents)) are called in the pipeline to update the build version of the artifacts.

## 1. How version is set in *.jar artifacts
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like the numbers. They are hard to maintain to keep them consistent and we don't really need them.

Suggested change
## 1. How version is set in *.jar artifacts
## How version is set in *.jar artifacts


## 3. Notes

What is important to keep is that the versions in the root pom.xml, and the [MainVersion field](https://github.com/SonarSource/sonar-dotnet/blob/master/scripts/version/Version.props#L3) in the `Version.props` must
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
What is important to keep is that the versions in the root pom.xml, and the [MainVersion field](https://github.com/SonarSource/sonar-dotnet/blob/master/scripts/version/Version.props#L3) in the `Version.props` must
What is important to keep is that the versions in the root pom.xml, and the [MainVersion](https://github.com/SonarSource/sonar-dotnet/blob/master/scripts/version/Version.props#L3) field in the `Version.props` must

1. [SonarAnalyzer.CSharp.Styling.nuspec](../../analyzers/packaging/SonarAnalyzer.CSharp.Styling.nuspec)
1. [AssemblyInfo.Shared.cs](../../analyzers/src/AssemblyInfo.Shared.cs)

However, during the sonar-dotnet pipeline run, the files 2-6 above, have any reference to the semantic version replaced by the value in the [MainVersion field](https://github.com/SonarSource/sonar-dotnet/blob/a998f32eac72c7b6b4562935ffb8d423c6ebf936/scripts/version/Version.props#L3) of the `Version.props` file. This happens during the build of the [`ChangeVersion.proj`](./ChangeVersion.proj) that is [executed in the pipeline](https://github.com/SonarSource/sonar-dotnet/blob/master/azure-pipelines.yml#L91).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pipeline #L91 needs a fixed commit. Otherwise it will go out of sync with very next pipeline change

1. [SonarAnalyzer.CSharp.Styling.nuspec](../../analyzers/packaging/SonarAnalyzer.CSharp.Styling.nuspec)
1. [AssemblyInfo.Shared.cs](../../analyzers/src/AssemblyInfo.Shared.cs)

However, during the sonar-dotnet pipeline run, the files 2-6 above, have any reference to the semantic version replaced by the value in the [MainVersion field](https://github.com/SonarSource/sonar-dotnet/blob/a998f32eac72c7b6b4562935ffb8d423c6ebf936/scripts/version/Version.props#L3) of the `Version.props` file. This happens during the build of the [`ChangeVersion.proj`](./ChangeVersion.proj) that is [executed in the pipeline](https://github.com/SonarSource/sonar-dotnet/blob/master/azure-pipelines.yml#L91).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
However, during the sonar-dotnet pipeline run, the files 2-6 above, have any reference to the semantic version replaced by the value in the [MainVersion field](https://github.com/SonarSource/sonar-dotnet/blob/a998f32eac72c7b6b4562935ffb8d423c6ebf936/scripts/version/Version.props#L3) of the `Version.props` file. This happens during the build of the [`ChangeVersion.proj`](./ChangeVersion.proj) that is [executed in the pipeline](https://github.com/SonarSource/sonar-dotnet/blob/master/azure-pipelines.yml#L91).
However, during the sonar-dotnet pipeline run, the files 2-6 above, have any reference to the semantic version replaced by the value in the [MainVersion](https://github.com/SonarSource/sonar-dotnet/blob/a998f32eac72c7b6b4562935ffb8d423c6ebf936/scripts/version/Version.props#L3) field of the `Version.props` file. This happens during the build of the [`ChangeVersion.proj`](./ChangeVersion.proj) that is [executed in the pipeline](https://github.com/SonarSource/sonar-dotnet/blob/master/azure-pipelines.yml#L91).

Copy link

sonarcloud bot commented May 28, 2024

Quality Gate Passed Quality Gate passed for 'Sonar .NET Java Plugin'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link

sonarcloud bot commented May 28, 2024

Quality Gate Passed Quality Gate passed for 'SonarAnalyzer for .NET'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@mary-georgiou-sonarsource mary-georgiou-sonarsource merged commit 0f0b094 into master May 28, 2024
26 checks passed
@mary-georgiou-sonarsource mary-georgiou-sonarsource deleted the mary/doc-versioning branch May 28, 2024 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants